﻿using System;
using System.Collections.Generic;
using System.Text;
using HySoft.Cash.Structure;
using System.Data.SqlClient;
using Huayou.Common.Database;
using HySoft.Cash.BaseClass;

namespace HySoft.Cash.DB
{
    public class TcapitalFlowingDB : BaseDB
    {
        public TcapitalFlowingDB(DBOperate oper)
            : base(oper)
        {
        }

        public bool ADD(TcapitalFlowingDT details)
        {
            int num = 0;
            string sql = "Insert Into tCapitalFlowing(ID,OrgID,Direction,Principal,Interest,Penalty,LateInterestCharges,Total,Memo,TransDate,TransOperater,Other1,Other2,Other3,Other4) Values(@ID,@OrgID,@Direction,@Principal,@Interest,@Penalty,@LateInterestCharges,@Total,@Memo,@TransDate,@TransOperater,@Other1,@Other2,@Other3,@Other4)";
            SqlParameter[] ps ={
				new SqlParameter("@ID",details.ID),
                new SqlParameter("@OrgID",details.OrgID),
				new SqlParameter("@Direction",details.Direction),
				new SqlParameter("@Principal",details.Principal),
				new SqlParameter("@Interest",details.Interest),
				new SqlParameter("@Penalty",details.Penalty),
				new SqlParameter("@LateInterestCharges",details.LateInterestCharges),
				new SqlParameter("@Total",details.Total),
				new SqlParameter("@Memo",details.Memo),
				new SqlParameter("@TransDate",details.TransDate),
				new SqlParameter("@TransOperater",details.TransOperater),
				new SqlParameter("@Other1",details.Other1),
				new SqlParameter("@Other2",details.Other2),
				new SqlParameter("@Other3",details.Other3),
				new SqlParameter("@Other4",details.Other4)};

            try
            {
                num = base.ExecuteForInt(sql, ps);
            }
            finally { }

            return (num == 1);
        }
    }
}
